import axios from '@/util/request'

export const registryReq = user =>{
    return axios({
        url:'/user/registry',
        method:'post',
        data:user
    })
}
export const deleteById = id =>{
    return axios({
        url:'/admins/delete',
        method:'post',
        data:id
    })
}
export const queryPage = (admins, pageNum, pageSize) => {
    return axios({
        url: '/admins/queryByPage',
        method: 'get',
        params: {
            // 只传递admins对象中的acount属性
              // 使用可选链操作符避免admins为null时出错
            
            pageNum,
            pageSize,
            acount: admins.acount,
        }
    })
}
export const insertSave = data =>{
    return axios({
        url:'/admins/add',
        method:'post',
        data:data
    })
}